home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / print / laser.zip / LISAJOUS.PAS < prev    next >
Pascal/Delphi Source File  |  1988-03-26  |  2KB  |  52 lines

  1. Program Lisajous;
  2. {This program creates a lisajous plot file}
  3.  
  4. Var
  5.   I:              Integer;
  6.   File_var:       Text;
  7.   Pi2:            Real;
  8.   t:              Real;
  9.  
  10. Begin
  11.   Assign (File_var, 'Lisajous.dat');
  12.   Rewrite(File_var);
  13.  
  14.   {Add header to data file; -1 indicates data file includes header.}
  15.   Writeln(File_var, '-1');
  16.   Writeln(File_var, 'Lisajous plot');                   {header line 1}
  17.   Writeln(File_var, 'X = Sine(3t); Y = Sine(16t)');     {header line 2}
  18.   Writeln(File_var, '3');  {3 sets of data in plot; one is the lisajous data,
  19.                             the other two are for the axes}
  20.   Writeln(File_var, '2001'); {points in the lisajous curve}
  21.   Writeln(File_var, 'y');    {lines between points}
  22.   Writeln(File_var, 'n');    {mark points with icons}
  23.   Pi2 := pi/1000.0;
  24.   For I:=0 to 2000 do
  25.   Begin
  26.     t := I * pi2;
  27.     Writeln(File_var, sin(3*t));    {x coordinate}
  28.     Writeln(File_var, sin(16*t));   {y coordinate}
  29.   End;
  30.  
  31.   {This section puts a horizontal reference line through the plot}
  32.   Writeln(File_var, '2');
  33.   Writeln(File_var, 'y');   {lines between points}
  34.   Writeln(File_var, 'n');   {mark points with icons}
  35.   Writeln(File_var, '-1.1');{x position of start point}
  36.   Writeln(File_var, '0.0'); {y position of start point}
  37.   Writeln(File_var, '1.1'); {x position of end point}
  38.   Writeln(File_var, '0.0'); {y position of end point}
  39.  
  40.   {This section puts a vertical reference line through the plot}
  41.   Writeln(File_var, '2');
  42.   Writeln(File_var, 'y');   {lines between points}
  43.   Writeln(File_var, 'n');   {mark points with icons}
  44.   Writeln(File_var, '0.0'); {x position of start point}
  45.   Writeln(File_var, '1.1'); {y position of start point}
  46.   Writeln(File_var, '0.0'); {x position of end point}
  47.   Writeln(File_var, '-1.1');{y position of end point}
  48.  
  49.   Close(File_var);
  50.  
  51. End.
  52.